# 批量执行命令
cat > /usr/local/bin/xcall.sh <<EOF
#!/usr/bin/bash
set -e

for host in node1 node2 node3
do
  echo "===== \$host \$1 ====="
  ssh \$host "source /etc/profile;\$@"
done
EOF
chmod 755 /usr/local/bin/xcall.sh
